import axios from 'axios';
import { Message } from 'element-ui';

const http = axios.create({
  baseURL: 'http://157.122.54.189:9095'
});

http.interceptors.response.use(res => {
  console.log('拦截到正常响应状态码为200的请求');
  return res;
},
  err => {
    console.log('拦截到状态码本身出错');
    console.dir(err);
    Message.error(error.response.data.message || '系统错误');
  }
);

export default http;